export default function xlsxDataFormat(
  data: Array<Array<any>>,
  titleMap: { [key: string]: string },
) {
  if (!data.length) return null;
  const result = [];
  const dataTile = data[0].map((title) => titleMap[title] || title);
  for (let i = 1; i < data.length; i++) {
    // 这可能是一个空数组
    const item = data[i];
    const formatItem = {};
    for (let j = 0; j < item.length; j++) {
      const key = dataTile[j];
      formatItem[key] = item[j];
    }
    result.push(formatItem);
  }
  return result;
}
